#include "dominion.h"
#include "dominion_helpers.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int cardtest1(){
	int i;
	int seed = 1000;
	int numPlayer = 2;
	int testhand_count1, testhand_count2;
	int testbuys1, testbuys2;
	int handPos, choice1, choice2, choice3;
	int bonus;
	int k[10] = {council_room, great_hall, feast, gardens, mine, remodel, smithy, adventurer, baron, village};
	struct gameState G;
	int maxHandCount = 5;

	memset(&G, 0, sizeof(struct gameState));
	initializeGame(numPlayer, k, seed, &G);

	G.handCount[0] = 9;
	G.handCount[1] = 6;
	int other_handCount = G.handCount[1];
	G.numBuys = 6;
	testhand_count1 = numHandCards(&G);
	testbuys1 = G.numBuys;


	handPos = 1;

	cardEffect(k[0], choice1, choice2, choice3, &G, handPos, &bonus);

	testhand_count2 = numHandCards(&G);
	testbuys2 = G.numBuys;
	printf("Expected number is %i, Actual number is %i\n", testhand_count1+3, testhand_count2);
	printf("Expected card for other player %i, actual card number %i\n", other_handCount + 1, G.handCount[1]);
	printf("Expected actions is %i, Actual actions is %i\n", testbuys1+1, testbuys2);
	if(testhand_count1 + 3 == testhand_count2)
		printf("passed draw card test\n");
	else
		printf("failed draw card test\n");
	if(other_handCount + 1 == G.handCount[1])
		printf("passed other player draw card test\n");
	else
		printf("failed other player draw card test\n");
	if(testbuys1+1 == testbuys2)
		printf("passed actions test\n");
	else
		printf("failed actions add test\n");

	return 0;

}